package water.com.Log;

import water.com.Observer.Observer;

public class LogPrint implements Observer{
    private Log log;
    private LogSubject logSubject;

    public LogPrint(LogSubject logSubject,Log log){
        this.logSubject = logSubject;
        this.log = log;
        this.log.setLogSubject(logSubject);
        this.logSubject.setLog(log);
        this.logSubject.registerObserver(this);
    }

    @Override
    public void update(Object object) {
        Log log = (Log)object;
        System.out.println("WaterFrameWork "+Thread.currentThread().getId()+":"+System.currentTimeMillis()+"------>"+log.getLogString());
    }
}
